home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10268 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: ocbbs.gen.nz!not-for-mail
  2. From: steve@hn.ocbbs.gen.nz (Steve Detoni)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Segmentation Fault ???
  5. Date: 16 Mar 1996 23:41:29 +1300
  6. Message-ID: <4ie5sp$77c@hn.ocbbs.gen.nz>
  7. References: <4hsa7i$en3@wraith.its.uow.edu.au>
  8. NNTP-Posting-Host: hn.hn.planet.gen.nz
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Theeradech Paopeng (tp02@wraith.its.uow.edu.au) wrote:
  12. : Hello to all.
  13. :     I'm here to ask you guys about the "Segmentation Fault". 
  14. : I was run my program on Unix and I got run_time_error say that "Segmentation
  15. : Fault". I really no idea how to fix that problem. One more thing I have to tell to fix that problem. One more thing I have to tell
  16. : you guys is my program using pointer.
  17. :     Are there anyone here got any idea what wrong with my program??? 
  18. : I really appreciate that if someone here can give me some hint to solve with 
  19. : that problem.
  20. :     Hope to hear from you very soon.
  21. O.k, the answer is simple. You are accessing 
  22. a piece of memory that doesn't belong to your program. Have you ever herd 
  23. of the NULL Pointer assignment error under DOS, well this is the same 
  24. thing. The most likly problem is that you are trying to read some 
  25. information as memory address 0, I know this as it's usually my problem 
  26. when i get this error message. Do not heed this error message as it's 
  27. Unix protecting itself from a program corrupting the system, plus it makes 
  28. for better/safer programs.
  29.  
  30. As simple way find the problem, first find the function where it's 
  31. occuring, and test each pointer assignment after it. Maybe even look uop 
  32. the assert() in the C libraries, this test function may provide additional 
  33. help.
  34.  
  35. Steve.
  36.